<!--
 * @Author: wwssaabb
 * @Date: 2021-06-05 16:36:56
 * @LastEditTime: 2021-06-07 18:00:53
 * @FilePath: \demo\echarts_demo\gauge_demo.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>gauge_demo</title>
  <script src="./lib/echarts.min.js"></script>
  <style>
    *{
      margin:0;
      padding:0;
      user-select: none;
    }
    body{
      width: 100vw;
      height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .container{
      width: 30vw;
      height: 30vw;
      border-radius: 50%;
      overflow: hidden;
      display: flex;
      justify-content: center;
      align-items: center;
      border: 1px solid #d8d8d8;
      box-shadow: 0 0 10px #d8d8d8;
    }
  </style>
</head>
<body>
  <div class="container"></div>

  <script type="text/javascript">
    var gaugeData=[{value:98}]

    const mCharts=echarts.init(document.querySelector('.container'),'dark')

    const option={
      series:{
        type:'gauge',
        data:gaugeData,
        min:0,
        max:160
      }
    }
  
    mCharts.setOption(option)

    setInterval(()=>{
      gaugeData[0].value=gaugeData[0].value=0?0:gaugeData[0].value-1
      option.series.data=gaugeData,
      mCharts.setOption(option)
    },2000)
  
  </script>
</body>
</html>